﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Administrator.Master" AutoEventWireup="true" CodeBehind="ManageSurvey.aspx.cs" Inherits="ProjectSemIII.Administrator.Survey.ManageSurvey" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    Manage Survey
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="pagination">
        <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbError"></asp:Label>
    </div>
    <div class="pagination">
        <asp:Repeater ID="totalPage" runat="server">
            <HeaderTemplate>
                <ul class="pages">
                    <li class="prev">
                        <asp:LinkButton runat="server" ID="btPrev" OnClick="btPrev_Click">&lt;</asp:LinkButton></li>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:LinkButton runat="server" ID="PageNumber" OnClick="PageNumber_Click" Text='<%# Container.DataItem.ToString() %>'></asp:LinkButton></li>
            </ItemTemplate>
            <FooterTemplate>
                <li class="next">
                    <asp:LinkButton runat="server" ID="btNext" OnClick="btPrev_Click">&gt;</asp:LinkButton></li>
                </ul>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div class="widget">
        <div class="whead">
            <h6>All Survey</h6>
            <div class="clear"></div>
        </div>
        <asp:Repeater ID="allSurvey" runat="server" OnItemCommand="allSurvey_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" width="100%" class="tDefault checkAll tMedia" id="checkAll">
                    <thead>
                        <tr>
                            <td width="50">ID</td>
                            <td class="sortCol">
                                <div>Survey Name<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Description<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Survey Images<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Date Start<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>DateLine<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>Status<span></span></div>
                            </td>
                            <td width="100">Actions</td>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Eval("SurveyID") %></td>
                    <td class="textL"><%# Eval("SurveyName") %></td>
                    <td class="textL"><%# Eval("SurveyDesc").ToString().Length < 100 ?  Eval("SurveyDesc").ToString().Substring(5,Eval("SurveyDesc").ToString().Length-6) : Eval("SurveyDesc").ToString().Substring(5,94)+" ..."%></td>
                    <td class="textL">
                        <asp:Image runat="server" Width="100" Height="100" ID="ImagesSurvey" ImageUrl='<%# string.Format("~/Images/Surveys/{0}",Eval("SurveyImage")) %>' /></td>
                    <td class="textL"><%# Eval("SurveyStartDate") %></td>
                    <td class="textL"><%# Eval("SurveyDateLine") %></td>
                    <td class="textL">
                        <asp:Label ID="lbStatus" runat="server" Text='<%# Eval("SurveyStatus").ToString() == "1" ? "Opening" : Eval("SurveyStatus").ToString() == "0" ? "Closed" : "Wait Open"%>'></asp:Label></td>
                    <td class="tableActs">
                        <asp:ImageButton ID="ibViewStats" CommandName="Stats" CommandArgument='<%# Eval("SurveyID") %>' ImageUrl="~/App_Themes/Administrator/images/icons/stats.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Stats"></asp:ImageButton>
                        <asp:ImageButton ID="ibEditSurvey" CommandName="Edit" CommandArgument='<%# Eval("SurveyID") %>' Width="11px" Height="11px" ImageUrl="~/App_Themes/Administrator/images/icons/update.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Edit"></asp:ImageButton>
                        <asp:ImageButton ID="ibDeleteSurvey" CommandName="Delete" Width="11px" Height="11px" OnClientClick="return confirm('Are you sure that you want to delete this survey?');" CommandArgument='<%# Eval("SurveyID") %>' ImageUrl="~/App_Themes/Administrator/images/icons/delete.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Remove"></asp:ImageButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>

